<script src="jquery-1.8.2.min.js" type="text/javascript"></script><script type="text/javascript">    $(document).ready(function(){    // By Class    $('#clickId').click(function(){                var count = $('input[type="checkbox"]').size();              alert(count )    });      });  </script><p>  <a href="#" id="clickId">click me</a></p><input type="checkbox" >Cricket<br/><input type="checkbox" >Cricket<br/><input type="checkbox" >Cricket<br/><input type="checkbox" >Cricket<br/><input type="checkbox" >Cricket<br/><input type="checkbox" >Cricket<br/>